3.36 \(\int \frac {1}{(1+\cosh ^2(x))^2} \, dx\)

Optimal. Leaf size=35 \[ \frac {3 \tanh ^{-1}\left (\frac {\tanh (x)}{\sqrt {2}}\right )}{4 \sqrt {2}}-\frac {\sinh (x) \cosh (x)}{4 \left (\cosh ^2(x)+1\right )} \]

[Out]

-1/4*cosh(x)*sinh(x)/(1+cosh(x)^2)+3/8*arctanh(1/2*2^(1/2)*tanh(x))*2^(1/2)

________________________________________________________________________________________

Rubi [A]  time = 0.03, antiderivative size = 35, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {3184, 12, 3181, 206} \[ \frac {3 \tanh ^{-1}\left (\frac {\tanh (x)}{\sqrt {2}}\right )}{4 \sqrt {2}}-\frac {\sinh (x) \cosh (x)}{4 \left (\cosh ^2(x)+1\right )} \]

Antiderivative was successfully verified.

[In]

Int[(1 + Cosh[x]^2)^(-2),x]

[Out]

(3*ArcTanh[Tanh[x]/Sqrt[2]])/(4*Sqrt[2]) - (Cosh[x]*Sinh[x])/(4*(1 + Cosh[x]^2))

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 3181

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(-1), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Dist
[ff/f, Subst[Int[1/(a + (a + b)*ff^2*x^2), x], x, Tan[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x]

Rule 3184

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_), x_Symbol] :> -Simp[(b*Cos[e + f*x]*Sin[e + f*x]*(a + b*Sin[
e + f*x]^2)^(p + 1))/(2*a*f*(p + 1)*(a + b)), x] + Dist[1/(2*a*(p + 1)*(a + b)), Int[(a + b*Sin[e + f*x]^2)^(p
 + 1)*Simp[2*a*(p + 1) + b*(2*p + 3) - 2*b*(p + 2)*Sin[e + f*x]^2, x], x], x] /; FreeQ[{a, b, e, f}, x] && NeQ
[a + b, 0] && LtQ[p, -1]

Rubi steps

\begin {align*} \int \frac {1}{\left (1+\cosh ^2(x)\right )^2} \, dx &=-\frac {\cosh (x) \sinh (x)}{4 \left (1+\cosh ^2(x)\right )}-\frac {1}{4} \int -\frac {3}{1+\cosh ^2(x)} \, dx\\ &=-\frac {\cosh (x) \sinh (x)}{4 \left (1+\cosh ^2(x)\right )}+\frac {3}{4} \int \frac {1}{1+\cosh ^2(x)} \, dx\\ &=-\frac {\cosh (x) \sinh (x)}{4 \left (1+\cosh ^2(x)\right )}+\frac {3}{4} \operatorname {Subst}\left (\int \frac {1}{1-2 x^2} \, dx,x,\coth (x)\right )\\ &=\frac {3 \tanh ^{-1}\left (\frac {\tanh (x)}{\sqrt {2}}\right )}{4 \sqrt {2}}-\frac {\cosh (x) \sinh (x)}{4 \left (1+\cosh ^2(x)\right )}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.13, size = 35, normalized size = 1.00 \[ \frac {3 \tanh ^{-1}\left (\frac {\tanh (x)}{\sqrt {2}}\right )}{4 \sqrt {2}}-\frac {\sinh (2 x)}{4 (\cosh (2 x)+3)} \]

Antiderivative was successfully verified.

[In]

Integrate[(1 + Cosh[x]^2)^(-2),x]

[Out]

(3*ArcTanh[Tanh[x]/Sqrt[2]])/(4*Sqrt[2]) - Sinh[2*x]/(4*(3 + Cosh[2*x]))

________________________________________________________________________________________

fricas [B]  time = 0.53, size = 214, normalized size = 6.11 \[ \frac {24 \, \cosh \relax (x)^{2} + 3 \, {\left (\sqrt {2} \cosh \relax (x)^{4} + 4 \, \sqrt {2} \cosh \relax (x) \sinh \relax (x)^{3} + \sqrt {2} \sinh \relax (x)^{4} + 6 \, {\left (\sqrt {2} \cosh \relax (x)^{2} + \sqrt {2}\right )} \sinh \relax (x)^{2} + 6 \, \sqrt {2} \cosh \relax (x)^{2} + 4 \, {\left (\sqrt {2} \cosh \relax (x)^{3} + 3 \, \sqrt {2} \cosh \relax (x)\right )} \sinh \relax (x) + \sqrt {2}\right )} \log \left (-\frac {3 \, {\left (2 \, \sqrt {2} - 3\right )} \cosh \relax (x)^{2} - 4 \, {\left (3 \, \sqrt {2} - 4\right )} \cosh \relax (x) \sinh \relax (x) + 3 \, {\left (2 \, \sqrt {2} - 3\right )} \sinh \relax (x)^{2} + 2 \, \sqrt {2} - 3}{\cosh \relax (x)^{2} + \sinh \relax (x)^{2} + 3}\right ) + 48 \, \cosh \relax (x) \sinh \relax (x) + 24 \, \sinh \relax (x)^{2} + 8}{16 \, {\left (\cosh \relax (x)^{4} + 4 \, \cosh \relax (x) \sinh \relax (x)^{3} + \sinh \relax (x)^{4} + 6 \, {\left (\cosh \relax (x)^{2} + 1\right )} \sinh \relax (x)^{2} + 6 \, \cosh \relax (x)^{2} + 4 \, {\left (\cosh \relax (x)^{3} + 3 \, \cosh \relax (x)\right )} \sinh \relax (x) + 1\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(1+cosh(x)^2)^2,x, algorithm="fricas")

[Out]

1/16*(24*cosh(x)^2 + 3*(sqrt(2)*cosh(x)^4 + 4*sqrt(2)*cosh(x)*sinh(x)^3 + sqrt(2)*sinh(x)^4 + 6*(sqrt(2)*cosh(
x)^2 + sqrt(2))*sinh(x)^2 + 6*sqrt(2)*cosh(x)^2 + 4*(sqrt(2)*cosh(x)^3 + 3*sqrt(2)*cosh(x))*sinh(x) + sqrt(2))
*log(-(3*(2*sqrt(2) - 3)*cosh(x)^2 - 4*(3*sqrt(2) - 4)*cosh(x)*sinh(x) + 3*(2*sqrt(2) - 3)*sinh(x)^2 + 2*sqrt(
2) - 3)/(cosh(x)^2 + sinh(x)^2 + 3)) + 48*cosh(x)*sinh(x) + 24*sinh(x)^2 + 8)/(cosh(x)^4 + 4*cosh(x)*sinh(x)^3
 + sinh(x)^4 + 6*(cosh(x)^2 + 1)*sinh(x)^2 + 6*cosh(x)^2 + 4*(cosh(x)^3 + 3*cosh(x))*sinh(x) + 1)

________________________________________________________________________________________

giac [B]  time = 0.13, size = 59, normalized size = 1.69 \[ \frac {3}{16} \, \sqrt {2} \log \left (-\frac {2 \, \sqrt {2} - e^{\left (2 \, x\right )} - 3}{2 \, \sqrt {2} + e^{\left (2 \, x\right )} + 3}\right ) + \frac {3 \, e^{\left (2 \, x\right )} + 1}{2 \, {\left (e^{\left (4 \, x\right )} + 6 \, e^{\left (2 \, x\right )} + 1\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(1+cosh(x)^2)^2,x, algorithm="giac")

[Out]

3/16*sqrt(2)*log(-(2*sqrt(2) - e^(2*x) - 3)/(2*sqrt(2) + e^(2*x) + 3)) + 1/2*(3*e^(2*x) + 1)/(e^(4*x) + 6*e^(2
*x) + 1)

________________________________________________________________________________________

maple [B]  time = 0.06, size = 113, normalized size = 3.23 \[ -\frac {\frac {\left (\tanh ^{3}\left (\frac {x}{2}\right )\right )}{2}+\frac {\tanh \left (\frac {x}{2}\right )}{2}}{2 \left (\tanh ^{4}\left (\frac {x}{2}\right )+1\right )}+\frac {3 \sqrt {2}\, \ln \left (\frac {\tanh ^{2}\left (\frac {x}{2}\right )+\sqrt {2}\, \tanh \left (\frac {x}{2}\right )+1}{\tanh ^{2}\left (\frac {x}{2}\right )-\sqrt {2}\, \tanh \left (\frac {x}{2}\right )+1}\right )}{32}-\frac {3 \sqrt {2}\, \ln \left (\frac {\tanh ^{2}\left (\frac {x}{2}\right )-\sqrt {2}\, \tanh \left (\frac {x}{2}\right )+1}{\tanh ^{2}\left (\frac {x}{2}\right )+\sqrt {2}\, \tanh \left (\frac {x}{2}\right )+1}\right )}{32} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(1+cosh(x)^2)^2,x)

[Out]

-1/2*(1/2*tanh(1/2*x)^3+1/2*tanh(1/2*x))/(tanh(1/2*x)^4+1)+3/32*2^(1/2)*ln((tanh(1/2*x)^2+2^(1/2)*tanh(1/2*x)+
1)/(tanh(1/2*x)^2-2^(1/2)*tanh(1/2*x)+1))-3/32*2^(1/2)*ln((tanh(1/2*x)^2-2^(1/2)*tanh(1/2*x)+1)/(tanh(1/2*x)^2
+2^(1/2)*tanh(1/2*x)+1))

________________________________________________________________________________________

maxima [B]  time = 0.42, size = 59, normalized size = 1.69 \[ -\frac {3}{16} \, \sqrt {2} \log \left (-\frac {2 \, \sqrt {2} - e^{\left (-2 \, x\right )} - 3}{2 \, \sqrt {2} + e^{\left (-2 \, x\right )} + 3}\right ) - \frac {3 \, e^{\left (-2 \, x\right )} + 1}{2 \, {\left (6 \, e^{\left (-2 \, x\right )} + e^{\left (-4 \, x\right )} + 1\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(1+cosh(x)^2)^2,x, algorithm="maxima")

[Out]

-3/16*sqrt(2)*log(-(2*sqrt(2) - e^(-2*x) - 3)/(2*sqrt(2) + e^(-2*x) + 3)) - 1/2*(3*e^(-2*x) + 1)/(6*e^(-2*x) +
 e^(-4*x) + 1)

________________________________________________________________________________________

mupad [B]  time = 1.05, size = 76, normalized size = 2.17 \[ \frac {3\,\sqrt {2}\,\ln \left (-3\,{\mathrm {e}}^{2\,x}-\frac {3\,\sqrt {2}\,\left (12\,{\mathrm {e}}^{2\,x}+4\right )}{16}\right )}{16}-\frac {3\,\sqrt {2}\,\ln \left (\frac {3\,\sqrt {2}\,\left (12\,{\mathrm {e}}^{2\,x}+4\right )}{16}-3\,{\mathrm {e}}^{2\,x}\right )}{16}+\frac {\frac {3\,{\mathrm {e}}^{2\,x}}{2}+\frac {1}{2}}{6\,{\mathrm {e}}^{2\,x}+{\mathrm {e}}^{4\,x}+1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(cosh(x)^2 + 1)^2,x)

[Out]

(3*2^(1/2)*log(- 3*exp(2*x) - (3*2^(1/2)*(12*exp(2*x) + 4))/16))/16 - (3*2^(1/2)*log((3*2^(1/2)*(12*exp(2*x) +
 4))/16 - 3*exp(2*x)))/16 + ((3*exp(2*x))/2 + 1/2)/(6*exp(2*x) + exp(4*x) + 1)

________________________________________________________________________________________

sympy [B]  time = 3.47, size = 211, normalized size = 6.03 \[ - \frac {3 \sqrt {2} \log {\left (4 \tanh ^{2}{\left (\frac {x}{2} \right )} - 4 \sqrt {2} \tanh {\left (\frac {x}{2} \right )} + 4 \right )} \tanh ^{4}{\left (\frac {x}{2} \right )}}{16 \tanh ^{4}{\left (\frac {x}{2} \right )} + 16} - \frac {3 \sqrt {2} \log {\left (4 \tanh ^{2}{\left (\frac {x}{2} \right )} - 4 \sqrt {2} \tanh {\left (\frac {x}{2} \right )} + 4 \right )}}{16 \tanh ^{4}{\left (\frac {x}{2} \right )} + 16} + \frac {3 \sqrt {2} \log {\left (4 \tanh ^{2}{\left (\frac {x}{2} \right )} + 4 \sqrt {2} \tanh {\left (\frac {x}{2} \right )} + 4 \right )} \tanh ^{4}{\left (\frac {x}{2} \right )}}{16 \tanh ^{4}{\left (\frac {x}{2} \right )} + 16} + \frac {3 \sqrt {2} \log {\left (4 \tanh ^{2}{\left (\frac {x}{2} \right )} + 4 \sqrt {2} \tanh {\left (\frac {x}{2} \right )} + 4 \right )}}{16 \tanh ^{4}{\left (\frac {x}{2} \right )} + 16} - \frac {4 \tanh ^{3}{\left (\frac {x}{2} \right )}}{16 \tanh ^{4}{\left (\frac {x}{2} \right )} + 16} - \frac {4 \tanh {\left (\frac {x}{2} \right )}}{16 \tanh ^{4}{\left (\frac {x}{2} \right )} + 16} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(1+cosh(x)**2)**2,x)

[Out]

-3*sqrt(2)*log(4*tanh(x/2)**2 - 4*sqrt(2)*tanh(x/2) + 4)*tanh(x/2)**4/(16*tanh(x/2)**4 + 16) - 3*sqrt(2)*log(4
*tanh(x/2)**2 - 4*sqrt(2)*tanh(x/2) + 4)/(16*tanh(x/2)**4 + 16) + 3*sqrt(2)*log(4*tanh(x/2)**2 + 4*sqrt(2)*tan
h(x/2) + 4)*tanh(x/2)**4/(16*tanh(x/2)**4 + 16) + 3*sqrt(2)*log(4*tanh(x/2)**2 + 4*sqrt(2)*tanh(x/2) + 4)/(16*
tanh(x/2)**4 + 16) - 4*tanh(x/2)**3/(16*tanh(x/2)**4 + 16) - 4*tanh(x/2)/(16*tanh(x/2)**4 + 16)

________________________________________________________________________________________